|
![](/i/fill.gif) |
Hello,
when I was testing how I can translate a float like
1.23456789e-28
into a 6 bytes notation for a ppm file I noticed that
the float function int() has a maximum value.
Try this:
*************************************
#declare Num1 = pow(2,30);
#declare Num2 = pow(2,31);
#declare Num3 = pow(2,32);
#declare Int1 = int(Num1);
#declare Int2 = int(Num2);
#declare Int3 = int(Num3);
#debug concat("\nNum1 = ",str(Num1,0,-1),
" | Num2 = ",str(Num2,0,-1),
" | Num3 = ",str(Num1,0,-1))
#debug concat("\nInt1 = ",str(Int1,0,-1),
" | Int2 = ",str(Int2,0,-1),
" | Int3 = ",str(Int3,0,-1),"\n")
*************************************
The result for me was:
Persistence of Vision(tm) Ray Tracer Version 3.5 win32 (.icl)
....
Num1 = 1073741824.000000 | Num2 = 2147483648.000000 | Num3 = 1073741824.000000
Int1 = 1073741824.000000 | Int2 = -2147483648.000000 | Int3 = -2147483648.000000
There is no warning about a max value in the manual.
Maybe it is wise to do this.
Jaap Frank
Post a reply to this message
|
![](/i/fill.gif) |